#ifndef __CHAR_MANAGER_H__
#define __CHAR_MANAGER_H__
class DataBuf : public std::streambuf 
{ 
public:    
	DataBuf(char * d, size_t s)    
	{       
		setg(d, d, d + s);    
	} 
}; 

class CharManager: public manager<Char,CharId>,public singleton<CharManager>
{
public:
	CharManager(void);
	~CharManager(void);
	void loadFullCharInfo(Int32& nAccountId,Int32& nResult, Char*& pChar);
	void saveFullCharInfo(Int32& nAccountId);
	void loadOfflineCharInfo(Int32& nAccountId,Int32& nResult, Char*& pChar);
	void saveOfflineCharInfo(Int32& nAccountId);
	Int32 getCharIdByCharName(std::string strCharName);

	void unloadInvalidCharInfo();
	void sendFullCharInfo(UInt32& nSocketIdData,Int32& nSocketId,Int32& nSocketIdOnGate,Int32& nAccountId);
	void saveAllCharInfo();
};
#endif

